<?php

/**
 * 
 */
 
class diapo extends Plugin
{
    //    internal variables
    
    //    Constructor
    function __construct ( )
    {
        parent::__construct();
        $this->scope[]   = 'Item___construct';   
        $this->scope[]   = 'template';
        $this->droits    = 'VISITOR';
        $this->nom       = 'Diaporama';
        $this->className = 'diapo';
        $this->desc      = 'Fait un diaporama avec les images présentes sur cette page';
        $this->uniId     = 'DiapoUNIID';
        $this->version   = '0.1';
        $this->lesItems  = array();
    
        global $rechercheGet, $listTagsGet, $listTypesGet, $trisGet, $pageNb;
        $this->content   = 
            '<form action="index.php" method="get">
                <p>
                <input type="hidden" name="recherche" value="'.$rechercheGet.'" />
                <input type="hidden" name="tags" value="'.$listTagsGet.'" />
                <input type="hidden" name="types" value="'.$listTypesGet.'" />
                <input type="hidden" name="tris" value="'.$trisGet.'" />
                <input type="hidden" name="pageNb" value="'.$pageNb.'" />
                
                    <input type="hidden" name="PLUGIN" value="diapo" />
                    <input type="submit" value="Lancer le diaporama"/>
                    <input class="bAnnuler" value="Fermer" type="button" />
                </p>
            </form>';
        
        
    }    
    
    public function Item___construct($item)
    {
        if($item->getType() == IMG)
        {
            $this->lesItems[] = $item;
        }
    }
    
    public function action()
    {        
        if(parent::action() == 'nop') return 'nop';
        if(!$this->ok()) return 'd_err1';
        include 'plugin/diapo/do.php';
        exit(0);
        
    }

}


?>
